#include<iostream>
#include<string>
using namespace std;
int a,n,S,r;
char ch;
bool f;
string l,s[1010],c,ans[1010];
int main(){
	freopen("network.in","r",stdin);
	freopen("network.out","w",stdout);
	r=0;
	cin >> n;
	S=0;
	for(int i = 0;i < n;i++){
		cin >> l;
		if(l=="Server"){
			cin >> l;
			for(int i = 0;i < S;i++){
				if(s[i]==l){
					ans[r] = "FATL";
					r++;
					continue;
				}
			}
			s[S]=l;
			S++;
			r = "OK";
			r++;
		}else{
			cin >> l;
			for(int i = 0;i < S;i++){
				if(s[i]==l){
					r = "OK";
					r++;
					continue;
				}
			}
			ans[r] = "FATL";
			r++;
		}
	}
	for(int i = 0;i < r;i++){
		cout << ans[i] << endl;
	}
	return 0;
}
/*
5
Server 192.168.1.1:8080
Server 192.168.1.1:8080
Client 192.168.1.1:8080
Client 192.168.1.1:80
Client 192.168.1.1:99999*/
